const UIManage = require("UIManage");
cc.Class({
    extends: cc.Component,

    properties: {
        numLabel: cc.Label,
        btn: cc.Node,
    },

    onLoad() {
        this.btn.on("click", this._click, this);

        let hb_10 = this.node.getChildByName("hb_10");
        hb_10.runAction(cc.repeatForever(cc.sequence(cc.scaleTo(0.5, 1.2), cc.scaleTo(0.5, 1))));
    },

    _click() {
        UIManage.Instance.ShowCashOut();
    },

    update(dt) {
        let num = Utils.getRedPacketNum();
        if (num == 0) {
            this.numLabel.string = "0.00";
            return;
        }
        this.numLabel.string = num.toFixed(2);
    },
});
